#include <iostream>
#include <vector>
#include <cstring>
#include "tile.h"
#include "puzzle.h"

using namespace std;

string tile_colors[10] = {"#000000", "#C17D11", "#CC0000", "#F57900", "#EDD400", "#73D216", "#3465A4", "#75507B", "#BABDB6", "#FFFFFF"};
string text_colors[10] = {"#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#000000", "#000000", "#FFFFFF", "#FFFFFF", "#000000", "#000000"};

void move(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, Puzzle &puzzle) {
	cout << "move (" << x0 << ", " << y0 << ") to (" << x1 << ", " << y1 << ") = " << puzzle.move(x0, y0, x1, y1) << endl;
	puzzle.print();
}

int main() {
	int size = 2;
	Puzzle *puzzle = new Puzzle(size);
	vector<vector<Tile*> > board = puzzle->getBoard();
	puzzle->print();
	move(2, 0, 0, 0, *puzzle);
	move(3, 0, 1, 1, *puzzle);
	move(2, 1, 0, 1, *puzzle);
	move(1, 1, 2, 1, *puzzle);
	move(1, 1, 3, 0, *puzzle);
	cout << "reset game..." << endl;
	puzzle->reset();
	puzzle->print();
	cout << "start a new game..." << endl;
	puzzle->newGame();
	puzzle->print();
	cout << "start a new game 2..." << endl;
	puzzle->newGame();
	puzzle->print();
	delete puzzle;
}
